package com.young.core.domain;

import java.io.Serializable;
import java.util.Date;

/**
 *
 * 客户端节点，由client通过register接口周期性上报、包括
 * 在任务调度触发时，用于选择客户端地址
 */
public class NodeDO implements Serializable {

    private int id;

    private String project;

    private String profile = "default";

    private String cloud = "default";

    /**
     * 客户端的分组名，此字段将会与JobDO.group产生关系
     */
    private String group;

    private String hostName;

    private String ip;

    /**
     * 回调时使用
     */
    private int port;

    private String instanceId;

    private String clientVersion;

    private Date createTime;

    private Date updateTime;

    /**
     * 是否为http协议，否则为grpc
     */
    private transient boolean httpProtocol = true;

    public NodeDO() {
    }

    public NodeDO(String ip, int port) {
        this.ip = ip;
        this.port = port;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getProject() {
        return project;
    }

    public void setProject(String project) {
        this.project = project;
    }

    public String getProfile() {
        return profile;
    }

    public void setProfile(String profile) {
        this.profile = profile;
    }

    public String getCloud() {
        return cloud;
    }

    public void setCloud(String cloud) {
        this.cloud = cloud;
    }

    public String getGroup() {
        return group;
    }

    public void setGroup(String group) {
        this.group = group;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String getHostName() {
        return hostName;
    }

    public void setHostName(String hostName) {
        this.hostName = hostName;
    }

    public String getInstanceId() {
        return instanceId;
    }

    public void setInstanceId(String instanceId) {
        this.instanceId = instanceId;
    }

    public String getClientVersion() {
        return clientVersion;
    }

    public void setClientVersion(String clientVersion) {
        this.clientVersion = clientVersion;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public boolean isHttpProtocol() {
        return httpProtocol;
    }

    public void setHttpProtocol(boolean httpProtocol) {
        this.httpProtocol = httpProtocol;
    }
}
